home *** CD-ROM | disk | FTP | other *** search
/ The Very Best of Atari Inside / The Very Best of Atari Inside 1.iso / mint / mgr / atari / demo.dif next >
Text File  |  1990-09-28  |  31KB  |  1,236 lines

  1. *** icon/orig/browse.c    Thu Aug 24 07:41:54 1989
  2. --- icon/browse.c    Tue Sep 11 16:31:12 1990
  3. ***************
  4. *** 62,73 ****
  5.      int n = -1;                /* current icon */
  6.      int clean();
  7.      char *getenv();
  8.      FILE *popen(), *fd = popen("/bin/pwd","r");
  9.      ckmgrterm( *argv );
  10.   
  11.      debug = (int) getenv("DEBUG");
  12.   
  13.      if (fd) {
  14.         fgets(cwd,sizeof(cwd),fd);
  15.         *(cwd + strlen(cwd) - 1) = '\0';    /* blah */
  16. --- 62,77 ----
  17.      int n = -1;                /* current icon */
  18.      int clean();
  19.      char *getenv();
  20. + #ifndef atarist
  21.      FILE *popen(), *fd = popen("/bin/pwd","r");
  22. ! #endif
  23.      ckmgrterm( *argv );
  24.   
  25.      debug = (int) getenv("DEBUG");
  26.   
  27. + #ifdef atarist
  28. +    getcwd(cwd, sizeof(cwd));
  29. + #else
  30.      if (fd) {
  31.         fgets(cwd,sizeof(cwd),fd);
  32.         *(cwd + strlen(cwd) - 1) = '\0';    /* blah */
  33. ***************
  34. *** 78,83 ****
  35. --- 82,88 ----
  36.         fprintf(stderr,"%s: can't get current directory\n",*argv);
  37.         exit(2);
  38.         }
  39. + #endif
  40.   
  41.      if (argc <2 || argc > MAXICONS) {
  42.         fprintf(stderr,"usage: %s icons... (up to %d)\n",*argv,MAXICONS);
  43. *** icon/orig/snap.c    Tue Jan 24 15:59:30 1989
  44. --- icon/snap.c    Sun Sep 23 18:52:06 1990
  45. ***************
  46. *** 70,75 ****
  47. --- 70,78 ----
  48.   
  49.      FILE *pf;
  50.      
  51. + #ifdef atarist
  52. +    _binmode(1);
  53. + #endif
  54.      ckmgrterm();
  55.   
  56.      debug = (int) getenv("DEBUG");
  57. ***************
  58. *** 140,146 ****
  59. --- 143,153 ----
  60.      menu_load(1,MENU_COUNT,menu);
  61.      menu_load(2,MENU_COUNT,rop);
  62.      m_selectmenu(1);
  63. + #ifdef atarist
  64. +    m_linkmenu(1,2,2,MF_AUTO);
  65. + #else
  66.      m_linkmenu(1,2,2,6);
  67. + #endif
  68.      m_clearmode(M_ACTIVATE);
  69.   
  70.      m_flush();
  71. ***************
  72. *** 204,211 ****
  73. --- 211,222 ----
  74.            break;
  75.         case 'F':                  /* file it */
  76.            if (tmp && !snapping) {
  77. + #ifdef atarist
  78. +             fclose(fp); fp = fopen(name, "w");
  79. + #else
  80.               fseek(fp,0L,0);
  81.               ftruncate(fileno(fp),0);
  82. + #endif
  83.           if (!bitmapwrite(fp,tmp,format) ) {
  84.                  m_push(P_ALL);
  85.                  m_font(0);
  86. *** icon/orig/zoom.c    Tue Jan 24 16:00:56 1989
  87. --- icon/zoom.c    Wed Sep 19 09:22:42 1990
  88. ***************
  89. *** 17,22 ****
  90. --- 17,25 ----
  91.   #include <sys/file.h>
  92.   #include "term.h"
  93.   #include "bitmap.h"
  94. + #ifdef atarist
  95. + #include "dump.h"
  96. + #endif
  97.   
  98.   /* general defines */
  99.   
  100. ***************
  101. *** 151,157 ****
  102. --- 154,164 ----
  103.   int debug=0;
  104.   char *title[MAXMARK];        /* title goes here */
  105.   int xmax,ymax,border;        /* screen parameters */
  106. + #ifdef atarist
  107. + char *str_save();
  108. + #else
  109.   char *str_save(), *sprintf();
  110. + #endif
  111.   char *prog;
  112.   
  113.   main(argc,argv)
  114. ***************
  115. *** 185,191 ****
  116. --- 192,202 ----
  117.      char dims[12];        /* string buffer for icon dims */
  118.      char line[512];        /* input buffer */
  119.   
  120. + #ifdef atarist
  121. +    char *malloc(), *rindex(), *get_str(), *strcpy();
  122. + #else
  123.      char *sprintf(), *malloc(), *rindex(), *get_str(), *strcpy();
  124. + #endif
  125.      int clean(), message();
  126.   
  127.      BITMAP *map;                /* what your editting */
  128. ***************
  129. *** 269,275 ****
  130. --- 280,291 ----
  131.      m_clear();
  132.      title[T_FUNC] = modes[mode].value;
  133.      title[T_OP] = options[function].value;
  134. + #ifdef atarist
  135. +    sprintf(dims,"%d x %d",W(map),H(map));
  136. +    title[T_SIZE] = dims;
  137. + #else
  138.      title[T_SIZE] = sprintf(dims,"%d x %d",W(map),H(map));
  139. + #endif
  140.      title[T_NAME] = name;
  141.      title[4] = NULL;
  142.      Do_title(title);
  143. ***************
  144. *** 383,390 ****
  145. --- 399,412 ----
  146.                       if (!yanked)
  147.                          message(SETMSG,"Can't yank bitmap");
  148.                       else
  149. + #ifdef atarist
  150. +                { sprintf(line, "Yanked bitmap %d x %d", W(new), H(new));
  151. +              message(SETMSG, line);
  152. +                }
  153. + #else
  154.                          message(SETMSG,sprintf(line,"Yanked bitmap %d x %d",
  155.                                  W(new),H(new)));
  156. + #endif
  157.                       break;
  158.                    case PUT:
  159.                       if (!yanked) {
  160. ***************
  161. *** 432,439 ****
  162. --- 454,466 ----
  163.                       zoom(map,x0,y0,x,y,SET);
  164.                       if (grid)
  165.                          draw_grid(map,x0,y0,x,y);
  166. + #ifdef atarist
  167. +                     sprintf(dims,"%d x %d", W(map),H(map));
  168. +             title[T_SIZE] = dims;
  169. + #else
  170.                       title[T_SIZE] = sprintf(dims,"%d x %d",
  171.                               W(map),H(map));
  172. + #endif
  173.                       Do_title(title);
  174.                       break;
  175.                    case GROW:
  176. ***************
  177. *** 456,463 ****
  178. --- 483,495 ----
  179.                       zoom(map,x0,y0,x,y,SET);
  180.                       if (grid)
  181.                          draw_grid(map,x0,y0,x,y);
  182. + #ifdef atarist
  183. +                     title[T_SIZE] = dims; sprintf(dims,"%d x %d",
  184. +                             W(map),H(map));
  185. + #else
  186.                       title[T_SIZE] = sprintf(dims,"%d x %d",
  187.                               W(map),H(map));
  188. + #endif
  189.                       Do_title(title);
  190.                       break;
  191.                    case SHIFT:
  192. ***************
  193. *** 522,528 ****
  194. --- 554,564 ----
  195.              zoom(map,x0,y0,x,y,SET);
  196.              if (grid)
  197.                 draw_grid(map,x0,y0,x,y);
  198. + #ifdef atarist
  199. +            title[T_SIZE] = dims; sprintf(dims,"%d x %d",W(map),H(map));
  200. + #else
  201.              title[T_SIZE] = sprintf(dims,"%d x %d",W(map),H(map));
  202. + #endif
  203.              Do_title(title);
  204.              if (function)
  205.                 INVERT(T_OP);
  206. ***************
  207. *** 560,566 ****
  208. --- 596,606 ----
  209.                 m_clear();
  210.                 code = get_scale(&x,&y,map);
  211.                 zoom(map,x0,y0,x,y,SET);
  212. + #ifdef atarist
  213. +               title[T_SIZE] = dims; sprintf(dims,"%d x %d",W(map),H(map));
  214. + #else
  215.                 title[T_SIZE] = sprintf(dims,"%d x %d",W(map),H(map));
  216. + #endif
  217.                 title[T_NAME] = strcpy(name,pntr);
  218.                 Do_title(title);
  219.                 if (grid)
  220. ***************
  221. *** 575,582 ****
  222. --- 615,628 ----
  223.                    bit_destroy(yanked);
  224.                 yanked = new;
  225.                 new = BIT_NULL;
  226. + #ifdef atarist
  227. +               sprintf(line,"Yanked %s (%d x %d)",
  228. +                       pntr,W(yanked),H(yanked));
  229. +           message(SETMSG, line);
  230. + #else
  231.                 message(SETMSG,sprintf(line,"Yanked %s (%d x %d)",
  232.                         pntr,W(yanked),H(yanked)));
  233. + #endif
  234.                 if (function == YANK) {
  235.                    INVERT(T_OP); 
  236.                    function = 0;
  237. ***************
  238. *** 655,661 ****
  239.                 zoom(map,x0,y0,x,y,SET);
  240.                 if (grid)
  241.                    draw_grid(map,x0,y0,x,y);
  242. !               title[T_SIZE] = sprintf(dims,"%d x %d", W(map),H(map));
  243.                 Do_title(title);
  244.                 }
  245.              break;
  246. --- 701,707 ----
  247.                 zoom(map,x0,y0,x,y,SET);
  248.                 if (grid)
  249.                    draw_grid(map,x0,y0,x,y);
  250. !               title[T_SIZE] = dims; sprintf(dims,"%d x %d", W(map),H(map));
  251.                 Do_title(title);
  252.                 }
  253.              break;
  254. ***************
  255. *** 907,919 ****
  256. --- 953,975 ----
  257.      char tmp[100];
  258.   
  259.      if ((fp = fopen(name,"r")) == NULL ) {
  260. + #ifdef atarist
  261. +       sprintf(tmp, "Can't find %s", name);
  262. +       message(SETMSG, tmp);
  263. + #else
  264.         message(SETMSG,sprintf(tmp,"Can't find %s",name));
  265. + #endif
  266.         return(BIT_NULL);
  267.         }
  268.   
  269.      if( !( map = bitmapread(fp) ) ) {
  270.         fclose(fp);
  271. + #ifdef atarist
  272. +       sprintf(tmp, "%s is not an icon or is damaged", name);
  273. +       message(SETMSG, tmp);
  274. + #else
  275.         message(SETMSG,sprintf(tmp,"%s is not an icon or is damaged",name));
  276. + #endif
  277.         return(BIT_NULL);
  278.         }
  279.   
  280. ***************
  281. *** 956,964 ****
  282. --- 1012,1027 ----
  283.      FILE *fp = fopen(name,"w");
  284.      char tmp[100];
  285.   
  286. + #ifdef atarist
  287. +    if (fp == NULL  || !bitmapwrite(fp,map,NEW_BHDR)) {
  288. +       dprintf(stderr, "Can't write file %s\n",name);
  289. +       sprintf(tmp, "Can't write file %s",name);
  290. +       message(SETMSG,tmp);
  291. + #else
  292.      if (fp == NULL  ||  !bitmapwrite(fp,map)) {
  293.         dprintf(stderr,"Can't write file %s\n",name);
  294.         message(SETMSG,sprintf(tmp,"Can't write file %s",name));
  295. + #endif
  296.         return(0);
  297.         }
  298.      fclose(fp);
  299. *** ify/orig/icondata.c    Mon Oct  2 09:17:26 1989
  300. --- ify/icondata.c    Mon Sep 17 21:54:50 1990
  301. ***************
  302. *** 64,77 ****
  303.       int s, old_mode, new_mode;
  304.   
  305.       m_flush();
  306.       ioctl(fileno(m_termout),TIOCLGET,&old_mode);
  307.       new_mode = old_mode | LLITOUT;
  308.       ioctl(fileno(m_termout),TIOCLSET,&new_mode);
  309.       m_bitdestroy(n);
  310.       m_bitldto(*w=68,*h=55,0,0,n,s=B_SIZE32(68,55,1));
  311.       fwrite(iconbits,s,1,m_termout);
  312.       m_flush();
  313.       ioctl(fileno(m_termout),TIOCLSET,&old_mode);
  314.   }
  315. --- 64,79 ----
  316.       int s, old_mode, new_mode;
  317.   
  318.       m_flush();
  319. + #ifndef atarist
  320.       ioctl(fileno(m_termout),TIOCLGET,&old_mode);
  321.       new_mode = old_mode | LLITOUT;
  322.       ioctl(fileno(m_termout),TIOCLSET,&new_mode);
  323. ! #endif
  324.       m_bitdestroy(n);
  325.       m_bitldto(*w=68,*h=55,0,0,n,s=B_SIZE32(68,55,1));
  326.       fwrite(iconbits,s,1,m_termout);
  327.       m_flush();
  328. ! #ifndef atarist
  329.       ioctl(fileno(m_termout),TIOCLSET,&old_mode);
  330. + #endif
  331.   }
  332. *** ify/orig/ify.c    Mon Oct  2 09:17:28 1989
  333. --- ify/ify.c    Tue Sep 18 23:44:54 1990
  334. ***************
  335. *** 62,68 ****
  336.   
  337.   /* general tty mashing stuff: */
  338.   #define TTYSUFFIXLEN (3)    /* length of ptty suffix + 1 */
  339. ! #define TTYPREFIX "/dev/tty"    /* prefix for pttys */
  340.   #define TTYPREFIXLEN (sizeof(TTYPREFIX)+1) /* length of TTYPREFIX+1 */
  341.   char ttytemp[TTYPREFIXLEN+TTYSUFFIXLEN];    /* for FULLTTYNAME() */
  342.   #define FULLTTYNAME(suff)    /* make full name from suffix - temporary! */\
  343. --- 62,73 ----
  344.   
  345.   /* general tty mashing stuff: */
  346.   #define TTYSUFFIXLEN (3)    /* length of ptty suffix + 1 */
  347. ! #ifdef atarist
  348. ! #define TTYPREFIX "Q:/ttyp."    /* prefix for pttys */
  349. ! #else
  350. ! #define TTYPREFIX "/dev/tty"
  351. ! #endif
  352.   #define TTYPREFIXLEN (sizeof(TTYPREFIX)+1) /* length of TTYPREFIX+1 */
  353.   char ttytemp[TTYPREFIXLEN+TTYSUFFIXLEN];    /* for FULLTTYNAME() */
  354.   #define FULLTTYNAME(suff)    /* make full name from suffix - temporary! */\
  355. ***************
  356. *** 172,177 ****
  357. --- 177,186 ----
  358.       m_ttyset();
  359.       m_push(P_EVENT | P_FLAGS | P_MENU | P_POSITION);
  360.       signal(SIGINT, catchint);
  361. + #ifdef atarist
  362. +     signal(SIGTTOU, SIG_IGN);
  363. +     signal(SIGTTIN, SIG_IGN);
  364. + #endif
  365.       DUPKEYOFF;
  366.       m_setmode(M_ABS);
  367.       m_setmode(M_NOWRAP);
  368. ***************
  369. *** 179,184 ****
  370. --- 188,196 ----
  371.       m_func(B_SRC);
  372.       m_flush();
  373.   
  374. + #ifdef atarist
  375. +     strcpy(ourtty, "/dev/fd2");        /* sigh -- the best we can do */
  376. + #else
  377.       {
  378.       char *ttyname();
  379.       char *t = ttyname(2);    /* get tty attached to stderr */
  380. ***************
  381. *** 187,203 ****
  382. --- 199,223 ----
  383.           shutdown("Can't find name of tty");
  384.       strcpy(ourtty, t);    /* make a copy of ttyname()'s value */
  385.       }
  386. + #endif
  387.   
  388.       /* turn off general write permission to the tty, so we can accept
  389.          m_sendme() messages */
  390.       {
  391. + #ifdef atarist
  392. +     oldmode = 0600;
  393. + #else
  394.       struct stat ttymode;
  395.   
  396.       if (stat(ourtty, &ttymode) == -1)
  397.         closedown(THEERROR("ourtty stat: "));
  398.       oldmode = ttymode.st_mode; /* get the old protection bits */
  399. + #endif
  400.       }
  401.   
  402. + #ifdef atarist
  403. +     windowpid = 0;
  404. + #else
  405.       /* Can we use m_sendto messages? */
  406.       if ((oldmode & 077) == 0 || chmod(ourtty, 00600) != -1)
  407.         windowpid = getwid();
  408. ***************
  409. *** 215,220 ****
  410. --- 235,241 ----
  411.       m_pop();
  412.       m_flush();
  413.       }
  414. + #endif
  415.   
  416.       get_param(NULL, &disp_w, &disp_h, &border);
  417.       get_font(&font_w, &font_h);
  418. ***************
  419. *** 437,443 ****
  420. --- 458,468 ----
  421.           FILE *ttyfp, *oldtermout;
  422.           int ttyfd;
  423.   
  424. + #ifdef atarist
  425. +         if ((ttyfp = fopen(FULLTTYNAME(tty), "a")) == NULL)
  426. + #else
  427.           if ((ttyfp = fopen(FULLTTYNAME(tty), "w")) == NULL)
  428. + #endif
  429.             closedown(THEERROR("open tty II: "));
  430.           ttyfd = fileno(ttyfp);
  431.   
  432. ***************
  433. *** 451,457 ****
  434. --- 476,486 ----
  435.           DUPKEYON;
  436.           
  437.           /* make sure that the window isn't currently ^S-ed */
  438. + #ifdef atarist
  439. +         if (iocuddle(ttyfd, TIOCSTART, 0) == -1)
  440. + #else
  441.           if (iocuddle(ttyfd, TIOCSTART) == -1)
  442. + #endif
  443.             closedown(THEERROR("iocuddle TIOCSTART II: "));
  444.   
  445.           /* don't notice the windows that haven't been closed yet */
  446. ***************
  447. *** 490,502 ****
  448.             sleep(WAITTIME);
  449.   
  450.           /* stop all output to that ptty */
  451.           if (iocuddle(ttyfd, TIOCSTOP) == -1)
  452.             closedown(THEERROR("iocuddle TIOCSTOP: "));
  453.           
  454.           /* queue escape codes to re-open them when output is
  455.              re-enabled */
  456.           foreachwindow(layout, layoutlen, tty, queueopen, CNULL);
  457.           fclose(ttyfp);    /* close the tty - we're done */
  458.   
  459.           makemenu();        /* refresh the menu's view of life */
  460. --- 519,536 ----
  461.             sleep(WAITTIME);
  462.   
  463.           /* stop all output to that ptty */
  464. + #ifdef atarist
  465. +         if (iocuddle(ttyfd, TIOCSTOP, 0) == -1)
  466. + #else
  467.           if (iocuddle(ttyfd, TIOCSTOP) == -1)
  468. + #endif
  469.             closedown(THEERROR("iocuddle TIOCSTOP: "));
  470.           
  471. + #ifndef atarist
  472.           /* queue escape codes to re-open them when output is
  473.              re-enabled */
  474.           foreachwindow(layout, layoutlen, tty, queueopen, CNULL);
  475. ! #endif
  476.           fclose(ttyfp);    /* close the tty - we're done */
  477.   
  478.           makemenu();        /* refresh the menu's view of life */
  479. ***************
  480. *** 535,546 ****
  481.       /* quick hack for positioning windows on a full screen */
  482.       static int next_x, next_y, widest;
  483.   
  484.       if (w->num == 0)
  485.         sprintf(title, "%-5s",
  486. !           (notify[0] == '\0' ? FULLTTYNAME(w->tty) : notify));
  487.       else
  488.         sprintf(title, "%-5s(%d)",
  489. !           (notify[0] == '\0' ? FULLTTYNAME(w->tty) : notify),
  490.             w->num);
  491.   
  492.       width = strlen(title)*font_w + 2*border;
  493. --- 569,586 ----
  494.       /* quick hack for positioning windows on a full screen */
  495.       static int next_x, next_y, widest;
  496.   
  497. + #ifdef atarist
  498. + #define NM_OFFSET 3
  499. + #else
  500. + #define NM_OFFSET 0
  501. + #endif
  502.       if (w->num == 0)
  503.         sprintf(title, "%-5s",
  504. !           (notify[0] == '\0' ? FULLTTYNAME(w->tty)+NM_OFFSET : notify));
  505.       else
  506.         sprintf(title, "%-5s(%d)",
  507. !           (notify[0] == '\0' ? FULLTTYNAME(w->tty)+NM_OFFSET : notify),
  508.             w->num);
  509.   
  510.       width = strlen(title)*font_w + 2*border;
  511. ***************
  512. *** 627,635 ****
  513. --- 667,689 ----
  514.       m_flush();
  515.   
  516.       /* re-enable output to that ptty */
  517. + #ifdef atarist
  518. +     DUPKEYOFF;
  519. +     layoutlen = get_all(layout);
  520. +     DUPKEYON;
  521. +     if (iocuddle(ttyfd, TIOCSTART, 0) == -1)
  522. + #else
  523.       if (iocuddle(ttyfd, TIOCSTART) == -1)
  524. + #endif
  525.         closedown(THEERROR("iocuddle TIOCSTART: "));
  526.       
  527. + #ifdef atarist
  528. +         /* send escape codes to re-open them when output is
  529. +            re-enabled */
  530. +         foreachwindow(layout, layoutlen, tty, queueopen, CNULL);
  531. + #endif
  532.       /* queue escape codes to let us know when they're all
  533.          opened, if we can */
  534.       if (windowpid != 0) {
  535. *** misc/orig/getpty.c    Thu Aug 24 07:29:46 1989
  536. --- misc/getpty.c    Wed Sep 19 10:45:08 1990
  537. ***************
  538. *** 12,18 ****
  539. --- 12,25 ----
  540.   #include <sys/wait.h>
  541.   
  542.   #include <sys/file.h>
  543. + #ifdef atarist
  544. + #include <signal.h>
  545. + #include <osbind.h>
  546. + #define TBDELAY 0
  547. + #define getdtablesize() 20
  548. + #else
  549.   #include <sys/signal.h>
  550. + #endif
  551.   #include <sgtty.h>
  552.   #include <stdio.h>
  553.   
  554. ***************
  555. *** 19,24 ****
  556. --- 26,37 ----
  557.   #include <errno.h>
  558.   #include <pwd.h>
  559.   
  560. + #ifdef atarist
  561. + # ifndef EWOULDBLOCK
  562. + #  define EWOULDBLOCK 130
  563. + # endif
  564. + #endif
  565.   /*
  566.   **    size of input and output buffers
  567.   */
  568. ***************
  569. *** 252,259 ****
  570. --- 265,277 ----
  571.   #define index        strchr
  572.   #endif
  573.   
  574. + #ifdef atarist
  575. + static char *line = "Q:/ttyp.XX";
  576. + static int  pty_index=5;    /* better hit rate than 0 */
  577. + #else
  578.   static char *line = "/dev/ptypX";
  579.   static int  pty_index=5;    /* better hit rate than 0 */
  580. + #endif
  581.   extern char **environ;
  582.   
  583.   /* place to save tty modes */
  584. ***************
  585. *** 273,279 ****
  586. --- 291,299 ----
  587.      char list[20];
  588.   
  589.      strcpy(list,"0123456789abcdef");
  590. + #ifndef atarist
  591.      line[5] = 'p';
  592. + #endif
  593.   /*
  594.      for(line[8]='p';line[8]!='r';line[8]='q')
  595.   */
  596. ***************
  597. *** 284,296 ****
  598. --- 304,322 ----
  599.        {
  600.           printf("trying %s\n",line);
  601.        }
  602. + #ifdef atarist
  603. +      if ((fd = Fcreate(line, FA_SYSTEM|FA_HIDDEN)) >= 0) {
  604. + #else
  605.            if ((fd = open(line,2)) >= 0) {
  606. + #endif
  607.               /* pty_index = (pty_index+i)%16; */
  608.           if (verboseflag)
  609.           {
  610.           printf("   GOT %s\n",line);
  611.           }
  612. + #ifndef atarist
  613.               line[5] = 't';
  614. + #endif
  615.               return(fd);
  616.               }
  617.            }
  618. ***************
  619. *** 300,306 ****
  620. --- 326,334 ----
  621.   int getatty()
  622.      {
  623.      int fd;
  624. + #ifndef atarist
  625.      line[5]='t';
  626. + #endif
  627.      fd=open(line,2);
  628.      if (fd<0) {
  629.         sleep(3);
  630. ***************
  631. *** 354,366 ****
  632. --- 382,398 ----
  633.   
  634.      if ((*file=getapty()) < 0)
  635.         return(-1);
  636. + #ifndef atarist
  637.      ioctl(*file,TIOCREMOTE,0);    /* I dunno */
  638.   
  639.      ioctl(0,TIOCGETD,&t_ldisc);
  640. + #endif
  641.      ioctl(0,TIOCGETP,&t_sgttyb);
  642.      ioctl(0,TIOCGETC,&t_tchars);
  643.      ioctl(0,TIOCGLTC,&t_ltchars);
  644. + #ifndef atarist
  645.      ioctl(0,TIOCLGET,&t_lflags);
  646. + #endif
  647.   
  648.      if ((pid=fork()) != 0) {
  649.         return(pid);
  650. ***************
  651. *** 395,400 ****
  652. --- 427,433 ----
  653.   
  654.      /* set the uid stuff up */
  655.   
  656. + #ifndef atarist
  657.      if (geteuid() < 2) {
  658.         int uid = getuid();
  659.         fchmod(fd,0622);
  660. ***************
  661. *** 408,425 ****
  662.   
  663.      dup(fd), dup(fd), dup(fd);
  664.      close(fd);
  665.      setpgrp(group,group);
  666.      ioctl(0,TIOCSPGRP,&group);
  667.   
  668.      t_ldisc=NTTYDISC;
  669.      t_sgttyb.sg_flags = ECHO|CRMOD|EVENP|ODDP;
  670.   
  671.      ioctl(0,TIOCSETD,&t_ldisc);
  672.      ioctl(0,TIOCSETP,&t_sgttyb);
  673.      ioctl(0,TIOCSETC,&t_tchars);
  674.      ioctl(0,TIOCSLTC,&t_ltchars);
  675.      ioctl(0,TIOCLSET,&t_lflags);
  676.   
  677.      /* add a utmp entry */
  678.   
  679. --- 441,467 ----
  680.   
  681.      dup(fd), dup(fd), dup(fd);
  682.      close(fd);
  683. ! #else
  684. !    Fforce(-1, fd); Fforce(0, fd); Fforce(1, fd); Fforce(2, fd);
  685. !    Fclose(fd);
  686. ! #endif
  687.      setpgrp(group,group);
  688.      ioctl(0,TIOCSPGRP,&group);
  689.   
  690. + #ifndef atarist
  691.      t_ldisc=NTTYDISC;
  692. + #endif
  693.      t_sgttyb.sg_flags = ECHO|CRMOD|EVENP|ODDP;
  694.   
  695. + #ifndef atarist
  696.      ioctl(0,TIOCSETD,&t_ldisc);
  697. + #endif
  698.      ioctl(0,TIOCSETP,&t_sgttyb);
  699.      ioctl(0,TIOCSETC,&t_tchars);
  700.      ioctl(0,TIOCSLTC,&t_ltchars);
  701. + #ifndef atarist
  702.      ioctl(0,TIOCLSET,&t_lflags);
  703. + #endif
  704.   
  705.      /* add a utmp entry */
  706.   
  707. ***************
  708. *** 448,453 ****
  709. --- 490,508 ----
  710.   
  711.   /* get a complete path name from command */
  712.   
  713. + #ifdef atarist
  714. + char *
  715. + get_path(name)
  716. + char *name;
  717. +    {
  718. +    char *getenv(), *findfile();
  719. +    static char *extensions[] = { "ttp", "prg", "tos", 0 };
  720. +    return findfile(name, getenv("PATH"), extensions);
  721. +    }
  722. + #else /* !atarist */
  723.   static char path[512];
  724.   static char start[512];
  725.   
  726. ***************
  727. *** 490,495 ****
  728. --- 545,552 ----
  729.         return((char *) 0);
  730.         }
  731.      }
  732. + #endif /* atarist */
  733.   
  734.   /* change an environment variable */
  735.   
  736. *** misc/orig/lock.c    Fri Sep 29 16:18:34 1989
  737. --- misc/lock.c    Wed Sep 19 11:55:50 1990
  738. ***************
  739. *** 5,11 ****
  740.    *       on copies, and credit should be given to Bellcore where it is due.
  741.    *       BELLCORE MAKES NO WARRANTY AND ACCEPTS NO LIABILITY FOR THIS PROGRAM.
  742.    */
  743. ! /* ************************************************************ *\
  744.   /* star-trek lock screen (sau/sdh) */
  745.   
  746.   #include <sgtty.h>
  747. --- 5,12 ----
  748.    *       on copies, and credit should be given to Bellcore where it is due.
  749.    *       BELLCORE MAKES NO WARRANTY AND ACCEPTS NO LIABILITY FOR THIS PROGRAM.
  750.    */
  751. ! /* ************************************************************ */
  752.   /* star-trek lock screen (sau/sdh) */
  753.   
  754.   #include <sgtty.h>
  755. ***************
  756. *** 19,31 ****
  757.   #define HIGH    BIT_HIGH(display)
  758.   #define NICE    10
  759.   
  760.   struct passwd *pwd, *getpwuid();
  761.   struct timeval poll = {0,50000};
  762.   struct sgttyb sg,save;
  763.   char buff[100];
  764.   static int dir = 1;
  765.   
  766. ! main()
  767.      {
  768.      int read;
  769.       int pid;
  770. --- 20,39 ----
  771.   #define HIGH    BIT_HIGH(display)
  772.   #define NICE    10
  773.   
  774. + #ifdef atarist
  775. + char passwd[80];
  776. + struct timeval poll = {1,0};
  777. + #else
  778.   struct passwd *pwd, *getpwuid();
  779.   struct timeval poll = {0,50000};
  780. + #endif
  781.   struct sgttyb sg,save;
  782.   char buff[100];
  783.   static int dir = 1;
  784.   
  785. ! main(argc, argv)
  786. !    int argc;
  787. !    char *argv[];
  788.      {
  789.      int read;
  790.       int pid;
  791. ***************
  792. *** 38,44 ****
  793. --- 46,56 ----
  794.           exit(1);
  795.         }
  796.   
  797. + #ifdef atarist
  798. +    strcpy(passwd, argv[1] ? argv[1] : "");
  799. + #else
  800.      pwd = getpwuid(getuid());
  801. + #endif
  802.   
  803.      signal(SIGINT,SIG_IGN);
  804.      signal(SIGHUP,SIG_IGN);
  805. ***************
  806. *** 56,72 ****
  807.      bit_blit(display,0,0,WIDE,HIGH,BIT_SET,NULL,0,0);
  808.      if (NICE > 0)
  809.         nice(NICE);
  810.       if ((pid=fork()) == 0) {/* child */
  811.           signal(SIGALRM,flop);
  812.           fly(display);
  813.           }
  814. !    else {
  815.           while(1) {
  816.               read = 1;
  817.               if (select(32,&read,0,0,&poll) && read) {
  818.                   gets(buff);
  819.                   kill(pid,SIGALRM);    /* change directions */
  820.                   if (strcmp(pwd->pw_passwd,crypt(buff,pwd->pw_passwd)) == 0) {
  821.                       stty(0,&save);
  822.                       kill(pid,SIGKILL);
  823.                       while(wait(0)!=pid);
  824. --- 68,94 ----
  825.      bit_blit(display,0,0,WIDE,HIGH,BIT_SET,NULL,0,0);
  826.      if (NICE > 0)
  827.         nice(NICE);
  828. + #ifdef atarist
  829. +         { void _do_fly();
  830. +            pid = tfork(_do_fly, display);
  831. +         }
  832. + #else
  833.       if ((pid=fork()) == 0) {/* child */
  834.           signal(SIGALRM,flop);
  835.           fly(display);
  836.           }
  837. !       else {
  838. ! #endif
  839.           while(1) {
  840.               read = 1;
  841.               if (select(32,&read,0,0,&poll) && read) {
  842.                   gets(buff);
  843.                   kill(pid,SIGALRM);    /* change directions */
  844. + #ifdef atarist
  845. +                 if (strcmp(passwd,buff) == 0) {
  846. + #else
  847.                   if (strcmp(pwd->pw_passwd,crypt(buff,pwd->pw_passwd)) == 0) {
  848. + #endif
  849.                       stty(0,&save);
  850.                       kill(pid,SIGKILL);
  851.                       while(wait(0)!=pid);
  852. ***************
  853. *** 75,81 ****
  854. --- 97,105 ----
  855.                       }
  856.                   }
  857.               }
  858. + #ifndef atarist
  859.           }
  860. + #endif
  861.       }
  862.   
  863.   /* star trek effect */
  864. ***************
  865. *** 94,100 ****
  866. --- 118,128 ----
  867.   #define BG_COLOR    4        /* usually blue */
  868.   #define SSIZE    2    /* star size */
  869.   #define MAXZ 500 /* maximum z depth */
  870. + #ifdef atarist
  871. + #define NSTARS 128
  872. + #else
  873.   #define NSTARS 256 /* maximum number of stars */
  874. + #endif
  875.   #define SPEED    6        /* star speed */
  876.   #define SCALE    (short)7    /* for rotator */
  877.   #define COUNT    (short)3    /* for rotator */
  878. ***************
  879. *** 243,245 ****
  880. --- 271,331 ----
  881.      {
  882.      dir = 1-dir;
  883.       }
  884. + #ifdef atarist
  885. + void
  886. + _do_fly(display)
  887. +     BITMAP *display;
  888. + {
  889. +     signal(SIGALRM, flop);
  890. +     fly(display);
  891. + }
  892. + /*
  893. +  * routines to fork off a thread to do the star flying
  894. +  */
  895. + #undef Random
  896. + #include <osbind.h>
  897. + #include <basepage.h>
  898. + #define STKSIZE 8192L
  899. + void
  900. + _start_thread(b)
  901. +     BASEPAGE *b;
  902. + {
  903. +     void (*func)();
  904. +     long arg;
  905. +     func = (void (*)())b->p_dbase;
  906. +     arg = b->p_dlen;
  907. +     func(arg);
  908. +     Pterm0();
  909. + }
  910. + int
  911. + tfork(func, arg)
  912. +     void (*func)();
  913. +     long arg;
  914. + {
  915. +     BASEPAGE *b;
  916. +     int pid;
  917. +     b = (BASEPAGE *)Pexec(PE_CBASEPAGE, 0L, "", 0L);
  918. +     Mshrink(b, STKSIZE);
  919. +     b->p_tbase = (char *)_start_thread;
  920. +     b->p_dbase = (char *)func;
  921. +     b->p_dlen = arg;
  922. +     pid = Pexec(104, 0L, b, 0L);
  923. +     return pid;
  924. + }
  925. + nice(x)
  926. + {
  927. + /* we should maybe call the MiNT Pnice() function; but we could get
  928. +    locked out if someone else has a high priority
  929. +  */
  930. + }
  931. + #endif /* atarist */
  932. *** misc/orig/mgrmode.c    Tue Jan 24 15:58:36 1989
  933. --- misc/mgrmode.c    Wed Sep 19 12:06:04 1990
  934. ***************
  935. *** 126,131 ****
  936. --- 126,143 ----
  937.   }
  938.   
  939.   
  940. + #if __STDC__
  941. + #define    CASE(arg)    if( EQ(#arg, mode) ) {\
  942. +                 switch( setclear ) {\
  943. +                 case SET:\
  944. +                     m_setmode( M_##arg );\
  945. +                     return;\
  946. +                 case CLEAR:\
  947. +                     m_clearmode( M_##arg );\
  948. +                     return;\
  949. +                 }\
  950. +             }
  951. + #else
  952.   #define    CASE(arg)    if( EQ("arg", mode) ) {\
  953.                   switch( setclear ) {\
  954.                   case SET:\
  955. ***************
  956. *** 136,141 ****
  957. --- 148,154 ----
  958.                       return;\
  959.                   }\
  960.               }
  961. + #endif
  962.   
  963.   static
  964.   action( setclear, mode, originalmode )
  965. *** misc/orig/set_emacs.c    Thu Jun  8 14:17:12 1989
  966. --- misc/set_emacs.c    Thu Sep 27 23:27:40 1990
  967. ***************
  968. *** 17,22 ****
  969. --- 17,35 ----
  970.   
  971.   #define ENTRY    "\'px|mgr|mgr teminal emulator:am:km:li#%d:co#%d:bs:cl=^L:ce=\\Ec:cd=\\EC:cm=\\E%%r%%d,%%dM:cs=\\E%%d,%%d%t:ve=\\Et:al=\\Ea:AL=\\E%%da:DL=\\E%%dd:dl=\\Ed:ic=\\EA:dc=\\EE:ta=^I:up=\\Eu:do=\\Ef:nd=\\Er:ku=\\E[A:kd=\\E[B:kr=\\E[C:kl=\\E[D:so=\\Ei:se=\\En:\'"
  972.   
  973. + #ifdef atarist
  974. + char *
  975. + getpass(str)
  976. + char *str;
  977. + {
  978. +     static char buf[80];
  979. +     fputs(str, stdout); fflush(stdout);
  980. +     fgets(buf, 80, stdin);
  981. +     return buf;
  982. + }
  983. + #endif
  984.   main(argc,argv)
  985.   int argc;
  986.   char **argv;
  987. ***************
  988. *** 38,48 ****
  989. --- 51,67 ----
  990.      sprintf(get,"%c%d%c",ESC,G_WINSIZE,E_GETINFO);
  991.      sscanf(getpass(get),"%d %d\n",&cols,&rows);
  992.      
  993. + #ifdef atarist
  994. +    if (b_flag && shell && strcmp(shell+strlen(shell)-2,"sh")!=0) {
  995. + #else
  996.      if (b_flag && shell && strcmp(shell+strlen(shell)-3,"csh")==0) {        /* csh */
  997.         printf("set noglob;");
  998. + #endif
  999.         printf("setenv TERMCAP ");
  1000.         printf(ENTRY,rows,cols);
  1001. + #ifndef atarist
  1002.         printf(";unset noglob\n");
  1003. + #endif
  1004.         }
  1005.      else                            /* /bin/sh */
  1006.        {
  1007. ***************
  1008. *** 51,54 ****
  1009. --- 70,76 ----
  1010.         printf(ENTRY,rows,cols);
  1011.         putchar('\n');
  1012.        }
  1013. + #ifdef atarist
  1014. +    return 0;
  1015. + #endif
  1016.      } 
  1017. *** misc/orig/set_termcap.c    Tue Mar 21 08:35:58 1989
  1018. --- misc/set_termcap.c    Thu Sep 27 23:27:40 1990
  1019. ***************
  1020. *** 17,22 ****
  1021. --- 17,35 ----
  1022.   
  1023.   #define ENTRY    "\'px|mgr|mgr teminal emulator:am:li#%d:co#%d:bs:cl=^L:ce=\\Ec:cd=\\EC:cm=\\E%%r%%d,%%dM:al=\\Ea:dl=\\Ed:ic=\\EA:dc=\\EE:ta=^I:up=\\Eu:do=\\Ef:nd=\\Er:ku=\\E[A:kd=\\E[B:kr=\\E[C:kl=\\E[D:so=\\Ei:se=\\En:vs=\\EV:ve=\\Ev:\'"
  1024.   
  1025. + #ifdef atarist
  1026. + char *
  1027. + getpass(str)
  1028. + char *str;
  1029. + {
  1030. +     static char buf[80];
  1031. +     fputs(str, stdout); fflush(stdout);
  1032. +     fgets(buf, 80, stdin);
  1033. +     return buf;
  1034. + }
  1035. + #endif
  1036.   main(argc,argv)
  1037.   int argc;
  1038.   char **argv;
  1039. ***************
  1040. *** 37,48 ****
  1041.   
  1042.      sprintf(get,"%c%d%c",ESC,G_WINSIZE,E_GETINFO);
  1043.      sscanf(getpass(get),"%d %d\n",&cols,&rows);
  1044. !    
  1045.      if (b_flag && shell && strcmp(shell+strlen(shell)-3,"csh")==0) {        /* csh */
  1046.         printf("set noglob;");
  1047.         printf("setenv TERMCAP ");
  1048.         printf(ENTRY,rows,cols);
  1049.         printf(";unset noglob\n");
  1050.         }
  1051.      else                            /* /bin/sh */
  1052.        {
  1053. --- 50,67 ----
  1054.   
  1055.      sprintf(get,"%c%d%c",ESC,G_WINSIZE,E_GETINFO);
  1056.      sscanf(getpass(get),"%d %d\n",&cols,&rows);
  1057. ! #ifdef atarist
  1058. !    if (b_flag && shell && strcmp(shell+strlen(shell)-2,"sh")!=0) {
  1059. ! #else
  1060.      if (b_flag && shell && strcmp(shell+strlen(shell)-3,"csh")==0) {        /* csh */
  1061.         printf("set noglob;");
  1062. + #endif
  1063.         printf("setenv TERMCAP ");
  1064.         printf(ENTRY,rows,cols);
  1065. + #ifndef atarist
  1066.         printf(";unset noglob\n");
  1067. + #endif
  1068.         }
  1069.      else                            /* /bin/sh */
  1070.        {
  1071. ***************
  1072. *** 51,54 ****
  1073. --- 70,76 ----
  1074.         printf(ENTRY,rows,cols);
  1075.         putchar('\n');
  1076.        }
  1077. + #ifdef atarist
  1078. +    return 0;
  1079. + #endif
  1080.      } 
  1081. *** misc/orig/show.c    Tue Jan 16 11:18:30 1990
  1082. --- misc/show.c    Wed Sep 19 10:33:24 1990
  1083. ***************
  1084. *** 40,45 ****
  1085. --- 40,49 ----
  1086.       int op = - 1;
  1087.      int clean();
  1088.   
  1089. + #ifdef atarist
  1090. +    _binmode(1);
  1091. +    stdin->_flag |= _IOBIN;    /* make everything binary mode */
  1092. + #endif
  1093.      ckmgrterm( *argv );
  1094.   
  1095.      /* check arguments */
  1096. ***************
  1097. *** 91,98 ****
  1098. --- 95,104 ----
  1099.   
  1100.      m_setup(0);
  1101.   
  1102. + #ifndef atarist
  1103.      ioctl(fileno(m_termout),TIOCLGET,&mode);
  1104.      mode |= LLITOUT;
  1105. + #endif
  1106.   
  1107.      signal(SIGINT,clean);
  1108.      signal(SIGTERM,clean);
  1109. ***************
  1110. *** 100,106 ****
  1111. --- 106,114 ----
  1112.      get_size(&wx,&wy,0,0);
  1113.      get_param(0,0,0,&border);
  1114.   
  1115. + #ifndef atarist
  1116.      ioctl(fileno(m_termout),TIOCLSET,&mode);
  1117. + #endif
  1118.   
  1119.       if (op != -1)
  1120.         m_func(op);
  1121. ***************
  1122. *** 133,139 ****
  1123. --- 141,149 ----
  1124.   clean(n)
  1125.   int n;
  1126.      {
  1127. + #ifndef atarist
  1128.      mode &= ~LLITOUT;
  1129.      ioctl(fileno(m_termout),TIOCLSET,&mode);
  1130. + #endif
  1131.      exit(n);
  1132.      }
  1133. *** tests/orig/half.c    Tue Jan 24 15:57:42 1989
  1134. --- tests/half.c    Mon Sep 17 22:07:16 1990
  1135. ***************
  1136. *** 15,24 ****
  1137. --- 15,31 ----
  1138.   #include <stdio.h>
  1139.   #include <sgtty.h>
  1140.   
  1141. + #ifdef atarist
  1142. + #define WIDE    300
  1143. + #define HIGH    150
  1144. + #define X    50
  1145. + #define Y    50
  1146. + #else
  1147.   #define WIDE    400
  1148.   #define HIGH    300
  1149.   #define X    200
  1150.   #define Y    200
  1151. + #endif
  1152.   
  1153.   main(argc,argv)
  1154.   int argc;
  1155. ***************
  1156. *** 78,85 ****
  1157.   
  1158.      else if (pid == 0) {        /* new shell (child) */
  1159.   
  1160. !       /* remove controlling tty */
  1161.   
  1162.         ioctl(open("/dev/tty",0),TIOCNOTTY,0);
  1163.   
  1164.         /* close all files */
  1165. --- 85,106 ----
  1166.   
  1167.      else if (pid == 0) {        /* new shell (child) */
  1168.   
  1169. ! #ifdef atarist
  1170. !       for (i = 3; i < 20; i++)
  1171. !           close(i);
  1172.   
  1173. +       i = open(name, 2);
  1174. +       if (i < 0) {
  1175. +           perror(name);
  1176. +           _exit(2);
  1177. +       }
  1178. +       dup2(i, -1);
  1179. +       dup2(i, 0);
  1180. +       dup2(i, 1);
  1181. +       dup2(i, 2);
  1182. +       close(i);
  1183. + #else
  1184. +       /* remove controlling tty */
  1185.         ioctl(open("/dev/tty",0),TIOCNOTTY,0);
  1186.   
  1187.         /* close all files */
  1188. ***************
  1189. *** 92,98 ****
  1190.         open(name,0);    /* stdin */
  1191.         open(name,1);    /* stdout */
  1192.         open(name,1);    /* stderr */
  1193. !    
  1194.         /* get our own process group */
  1195.         
  1196.         group = getpid();
  1197. --- 113,120 ----
  1198.         open(name,0);    /* stdin */
  1199.         open(name,1);    /* stdout */
  1200.         open(name,1);    /* stderr */
  1201. ! #endif
  1202.         /* get our own process group */
  1203.         
  1204.         group = getpid();
  1205.